package com.adwin.addcoin.ui.viewholder

import android.graphics.Color
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.adwin.addcoin.R
import com.adwin.addcoin.databinding.AdapterTaskDetailItemBinding
import com.adwin.addcoin.repository.bean.TaskStage

class TaskDetailHolder(var view: View): RecyclerView.ViewHolder(view)  {

    fun upDate(stage:TaskStage, position: Int){
        view.findViewById<TextView>(R.id.tv_task_title).text = "STEP${stage.stepNum}"
        view.findViewById<TextView>(R.id.tv_task_item_coins).text = "${stage.coinNum}"
        view.findViewById<TextView>(R.id.tv_task_name).text = "${stage.stepDesc}"
        if (position%2 == 0){
            view.findViewById<View>(R.id.cl_task_layout).setBackgroundColor(Color.parseColor("#FFF8F5"))
        }else{
            view.findViewById<View>(R.id.cl_task_layout).setBackgroundColor(Color.WHITE)
        }
    }
}